<template>
  <div class="app-container">
    <el-row :gutter="20">

      <!--用户数据-->
      <el-col :span="24">
        <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
          <el-form-item label="用户账号" prop="userName">
            <el-input
              v-model="queryParams.userName"
              placeholder="请输入用户账号"
              clearable
              size="small"
              style="width: 160px"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="手机号码" prop="phonenumber">
            <el-input
              v-model="queryParams.phonenumber"
              placeholder="请输入手机号码"
              clearable
              size="small"
              style="width: 160px"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="邀请码" prop="inviteCode">
            <el-input
              v-model="queryParams.inviteCode"
              placeholder="请输入邀请码"
              clearable
              size="small"
              style="width: 160px"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
<!--          <el-form-item label="状态" prop="status">-->
<!--            <el-select-->
<!--              v-model="queryParams.status"-->
<!--              placeholder="用户状态"-->
<!--              clearable-->
<!--              size="small"-->
<!--              style="width: 160px"-->
<!--            >-->
<!--              <el-option-->
<!--                v-for="dict in statusOptions"-->
<!--                :key="dict.dictValue"-->
<!--                :label="dict.dictLabel"-->
<!--                :value="dict.dictValue"-->
<!--              />-->
<!--            </el-select>-->
<!--          </el-form-item>-->
          <el-form-item label="类型" prop="peopleType">
            <el-select
              v-model="queryParams.peopleType"
              placeholder="用户类型"
              clearable
              size="small"
              style="width: 160px"
            >
              <el-option
                v-for="dict in typeOptions"
                :key="dict.dictValue"
                :label="dict.dictLabel"
                :value="dict.dictValue"
              />
            </el-select>
          </el-form-item>

          <el-form-item label="注册时间">
            <el-date-picker
              v-model="dateRange"
              size="small"
              style="width: 215px"
              value-format="yyyy-MM-dd"
              type="daterange"
              range-separator="-"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            ></el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          </el-form-item>
        </el-form>
        <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
          <el-table-column type="selection" width="50" align="center"/>
          <!-- <el-table-column label="用户头像" align="center" key="avatar" prop="avatar" >
            <template slot-scope="scope">
              <el-image v-if="scope.row.avatar"
                style="width: 40px; height: 40px;border-radius: 50%;"
                :src="scope.row.avatar"
                >
              </el-image>
            </template>
          </el-table-column> -->
          <el-table-column label="账号" align="left" key="userName" prop="userName" v-if="columns[1].visible"
                           :show-overflow-tooltip="true">
            <template slot-scope="scope">
              <el-button
                type="text"
                @click="handleShow(scope.row)"
              >{{scope.row.userName}}
              </el-button>
            </template>
          </el-table-column>
          <el-table-column label="名称" align="left" key="nickName" prop="nickName" v-if="columns[2].visible"
                           :show-overflow-tooltip="true"/>
          <!-- <el-table-column label="用户性别" align="center" prop="sex" :formatter="sexFormat" /> -->
          <el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible"
                           width="120"/>
          <!-- <el-table-column label="所属公司" align="center" prop="company.name" :show-overflow-tooltip="true" /> -->


          <!-- <el-table-column label="个人技能" align="center" prop="tags" /> -->

          <el-table-column label="注册时间" align="center" prop="createTime" v-if="columns[6].visible" width="170" >
            <template slot-scope="scope">
              <span >{{ parseTime(scope.row.createTime) }}</span>
            </template>
          </el-table-column>
          <el-table-column label="邀请码" align="center" key="inviteCode" prop="inviteCode"/>
          <el-table-column label="累计推广" align="center" prop="inviteCount"/>
          <el-table-column label="本月推广" align="center" prop="inviteCount"/>
          <el-table-column label="本月有效推广" align="center" prop="inviteCount"/>
          <el-table-column label="用户类型" align="center" prop="peopleType" :formatter="typeFormat"/>
          <el-table-column
            label="操作"
            align="center"
            width="260"
            class-name="small-padding fixed-width"
          >
            <template slot-scope="scope">
              <el-button
                size="mini"
                type="text"
                icon="el-icon-document"
                @click="handleInviteList(scope.row)"
              >推广明细
              </el-button>
              <template>
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-user"
                  @click="handleType(scope.row)"
                >用户设置
                </el-button>
              </template> <template>
              <el-button
                size="mini"
                type="text"
                icon="el-icon-user"
                @click="handleQR(scope.row)"
              >查看二维码
              </el-button>
            </template>

              <!--
                            <el-button
                              size="mini"
                              type="text"
                              icon="el-icon-search"
                              @click="handleShow(scope.row)"
                            >查看</el-button> -->

            </template>
          </el-table-column>
        </el-table>

        <pagination
          v-show="total>0"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getList"
        />
      </el-col>
    </el-row>

    <!-- 添加或修改参数配置对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px" :disabled="disabled">
        <el-row>
          <el-col :span="12">
            <el-form-item v-if="form.userId == undefined" label="用户账号" prop="userName">
              <el-input v-model="form.userName" placeholder="请输入用户账号"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
              <el-input v-model="form.password" placeholder="请输入用户密码" type="password"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="用户昵称" prop="nickName">
              <el-input v-model="form.nickName" placeholder="请输入用户昵称"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">

          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="手机号码" prop="phonenumber">
              <el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">

          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="用户性别">
              <el-select v-model="form.sex" placeholder="请选择">
                <el-option
                  v-for="dict in sexOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="状态">
              <el-radio-group v-model="form.status">
                <el-radio
                  v-for="dict in statusOptions"
                  :key="dict.dictValue"
                  :label="dict.dictValue"
                >{{dict.dictLabel}}
                </el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>

          <el-col :span="12">
            <el-form-item label="角色">
              <el-select v-model="form.roleIds" multiple placeholder="请选择">
                <el-option
                  v-for="item in roleOptions"
                  :key="item.roleId"
                  :label="item.roleName"
                  :value="item.roleId"
                  :disabled="item.status == 1"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="备注">
              <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm" v-if="!disabled">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>


    <el-dialog title="推广列表" :visible.sync="orderOpen" width="60%" append-to-body>
      <el-tabs v-model="tabActiveName" @tab-click="handleTabClick">
        <el-tab-pane label="用户信息" name="first">
          <el-table id="0" :data="userList1" >
            <el-table-column label="用户名称" align="center" >
              <template slot-scope="scope">
                <el-button
                  type="text"
                  @click="handleOrderList(scope.row)"
                >{{scope.row.nickName}}</el-button>
              </template>
            </el-table-column>

            <el-table-column label="用户性别" align="center" prop="sex" :formatter="sexFormat"/>
            <el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber"/>
            <el-table-column label="推广时间" align="center" prop="inviteTime">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.inviteTime) }}</span>
              </template>
            </el-table-column>
          </el-table>
          <pagination
            v-show="userTotal>0"
            :total="userTotal"
            :page.sync="queryInviteParams.pageNum"
            :limit.sync="queryInviteParams.pageSize"
            @pagination="getInviteUserList"/>
        </el-tab-pane>
        <el-tab-pane label="订单信息" name="second">
          <el-table id="1" :data="userOrderList">
            <el-table-column label="订单编号" align="center" prop="num"/>
            <el-table-column label="订单名称" align="center" prop="attribute"/>
            <el-table-column label="订单金额" align="center" prop="pay">
            </el-table-column>
          </el-table>
          <pagination
            v-show="userOrderTotal>0"
            :total="userOrderTotal"
            :page.sync="queryParams.pageNum"
            :limit.sync="queryParams.pageSize"
            @pagination="getOrderList"/>
        </el-tab-pane>
      </el-tabs>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <el-dialog title="设置身份" :visible.sync="typeOpen" width="650px"  append-to-body>
      <div>
        <div>
          <el-radio-group v-model="pType" align="center">
            <el-radio label="1">团长</el-radio>
            <el-radio label="0">普通</el-radio>
          </el-radio-group>
        </div>

        <div style="margin-top: 40px">
          <el-form v-show="pType === '1'" ref="form" model="form" :rules="rules"  label-width="80px" >
            <el-row :gutter="20">
              <el-col :span="12">
                <el-form-item label="开拓者" prop="trailblazer">
                  <el-input v-model="form.trailblazer" placeholder="请输入开拓者" style="width: 180px;margin-right: 5px"/>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="门牌照片" prop="headPhoto" >
                  <ImageUpload v-model="form.headPhoto" style="width: 180px;margin-left: 5px"/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="团长名称" prop="realName">
                  <el-input v-model="form.realName" placeholder="请输入团长名称" style="width: 180px;margin-right: 5px"/>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="微信号" prop="wechat">
                  <el-input v-model="form.wechat" placeholder="请输入备注信息" style="width: 180px;margin-right: 5px"/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="详细地址" prop="address">
                  <el-input v-model="form.address" placeholder="请输入详细地址" style="width: 180px;margin-right: 5px"/>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="备注" prop="comment">
                  <el-input v-model="form.comment" placeholder="请输入备注信息" style="width: 180px;margin-right: 5px"/>
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
        </div>
        <div  slot="footer" class="dialog-footer" align="center">
          <el-button @click="cancel2">取 消</el-button>
          <el-button v-show="pType === '1'" @click="confirm2();addTypeList()" type="primary">确定</el-button>
          <el-button v-show="pType === '0'" @click="confirm2()" type="primary">确定</el-button>
        </div>

      </div>

    </el-dialog>

    <el-dialog title="二维码展示" :visible.sync="QROpen" width="650px"  append-to-body>

        <div class="demo-image" style="text-align: center">
          <img :src="imgurl" />
        </div>
        <div  slot="footer" class="dialog-footer" align="center">
          <el-button  @click="saveImg" type="primary">下载</el-button>
        </div>

    </el-dialog>

  </div>
</template>

<script>
  import ImageUpload from '@/components/ImageUpload';
  import {listUser,QRCode, listInviteUser, changeUserStatus, getUser, updateUser} from "@/api/system/user";
  import {listUserType, selectUserTypeById, updateUserTypeById, addUserType} from "@/api/system/userType"
  import {getToken} from "@/utils/auth";
  import {getMiniCode} from "@/api/system/miniCode";
  import {treeselect} from "@/api/system/dept";
  import Treeselect from "@riophae/vue-treeselect";
  import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  import {listOrder, listUserOrder, listUserReceive} from "@/api/business/order";

  export default {
    name: "User",
    components: {Treeselect, ImageUpload},
    data() {
      return {
        pType: '',
        raw2: "",
        tabActiveName: "first",
        // 遮罩层
        loading: true,
        // 导出遮罩层
        exportLoading: false,
        disabled: false,
        // 选中数组
        ids: [],

        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        orderTotal: 0,
        userOrderTotal: 0,
        userTotal: 0,
        receiveTotal: 0,
        // 用户表格数据
        userList: null,
        userList1: null,
        addressList: null,
        orderList: null,
        userOrderList: null,
        receiveList: null,
        bankcardList: null,
        userIdByCode: null,
        miniCode: null,
        imgurl: null,
        // 弹出层标题
        title: "",
        // 部门树选项
        deptOptions: undefined,
        // 是否显示弹出层
        open: false,
        addressOpen: false,
        orderOpen: false,
        typeOpen: false,
        bankcardOpen: false,
        setOpen: false,
        QROpen: false,
        // 部门名称
        deptName: undefined,

        // 默认密码
        initPassword: undefined,
        user: null,
        // 日期范围
        dateRange: [],
        // 状态数据字典
        statusOptions: [],
        //推广人类别字典
        typeOptions: [],
        // 性别状态字典
        sexOptions: [],
        // 岗位选项
        postOptions: [],
        // 角色选项
        roleOptions: [],
        // 表单参数
        form: {
          uid: null
        },
        defaultProps: {
          children: "children",
          label: "label"
        },
        // 用户导入参数
        upload: {
          // 是否显示弹出层（用户导入）
          open: false,
          // 弹出层标题（用户导入）
          title: "",
          // 是否禁用上传
          isUploading: false,
          // 是否更新已经存在的用户数据
          updateSupport: 0,
          // 设置上传的请求头部
          headers: {Authorization: "Bearer " + getToken()},
          // 上传的地址
          url: process.env.VUE_APP_BASE_API + "/system/user/importData"
        },
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          userName: undefined,
          phonenumber: undefined,
          status: undefined,
          peopleType: undefined,
          deptId: undefined,
          inviteCode: undefined
        },
        queryOrderParams: {
          pageNum: 1,
          pageSize: 5,
        },
        queryReceiveParams: {
          pageNum: 1,
          pageSize: 5,
        },
        queryInviteParams: {
          pageNum: 1,
          pageSize: 5,
          inviteUserId: undefined,
          userName: undefined,
          phonenumber: undefined,
          status: undefined,
          peopleType: undefined,
          deptId: undefined
        },
        // 列信息
        columns: [
          {key: 0, label: `用户编号`, visible: true},
          {key: 1, label: `用户名称`, visible: true},
          {key: 2, label: `用户昵称`, visible: true},
          {key: 3, label: `部门`, visible: true},
          {key: 4, label: `手机号码`, visible: true},
          {key: 5, label: `状态`, visible: true},
          {key: 6, label: `创建时间`, visible: true}
        ],
        // 表单校验
        rules: {
          userName: [
            {required: true, message: "用户名称不能为空", trigger: "blur"}
          ],
          nickName: [
            {required: true, message: "用户昵称不能为空", trigger: "blur"}
          ],
          password: [
            {required: true, message: "用户密码不能为空", trigger: "blur"}
          ],
          phonenumber: [
            {
              required: true,
              pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
              message: "请输入正确的手机号码",
              trigger: "blur"
            }
          ]
        }
      };
    },

    created() {
      // this.getTypeList();
      //this.getUserOrderList();
      this.getList();
      // this.getTreeselect();
      this.getDicts("sys_normal_disable").then(response => {
        this.statusOptions = response.data;
      });
      this.getDicts("sys_leader_general").then(response => {
        this.typeOptions = response.data;
      });
      this.getDicts("sys_user_sex").then(response => {
        this.sexOptions = response.data;
      });
      this.getConfigKey("sys.user.initPassword").then(response => {
        // this.initPassword = response.msg;
      });
    },
    methods: {
      // 点击团长显示表格
      btntuan() {
        this.setOpen = true
      },


      handleQR(row){
        this.QROpen = true;
        this.imgurl=process.env.VUE_APP_BASE_API + '/miniapp/shareCode.jpg?userId=' + row.userId
        console.log(this.imgurl)
      },


      downloadIamge: function(imgsrc, name) {
        let image = new Image();
        image.setAttribute("crossOrigin", "anonymous");
        image.onload = function() {
          let canvas = document.createElement("canvas");
          canvas.width = image.width;
          canvas.height = image.height;
          let context = canvas.getContext("2d");
          context.drawImage(image, 0, 0, image.width, image.height);
          let url = canvas.toDataURL("image/png"); //得到图片的base64编码数据
          let a = document.createElement("a"); // 生成一个a元素
          let event = new MouseEvent("click"); // 创建一个单击事件
          a.download = name || "海报"; // 设置图片名称没有设置则为默认
          a.href = url; // 将生成的URL设置为a.href属性
          a.dispatchEvent(event); // 触发a的单击事件
        };
        image.src = imgsrc;
      },
      saveImg: function() {
        this.downloadIamge(this.imgurl, 'miniCode');
        //this.ResImgUrl：图片地址，result：图片名称
      },


      /** 查看地址操作 */
      handleOrderList(row, column, event) {
        console.log(row)
        this.tabActiveName = "second"
        const userId = row.userId || this.ids;
        this.form.uid = userId;
        //console.log(this.form.uid)
        this.orderOpen = true;
        this.userOrderList = null;
        this.receiveList = null;
        this.$nextTick(() => {
          getUser(userId).then(response => {
            this.form = response.data;
            this.postOptions = response.posts;
            this.roleOptions = response.roles;
            this.form.postIds = response.postIds;
            this.form.roleIds = response.roleIds;
            this.getOrderList();
            this.getReceiveList();
          });
        });
      },

      addTypeList() {
        // this.reset();
        console.log(this.form);
        addUserType({
          ...this.form,

        }).then(response => {
          //console.log(data)
          this.msgSuccess("团长设置成功!");
          this.getTypeList();
          this.typeOpen = false;
        });
      },
      // 用户性别字典翻译
      typeFormat(row, column) {
        return this.selectDictLabel(this.typeOptions, row.peopleType);
      },

      handleType(row) {

        this.raw2 = row;
        // this.reset();
        //const id = row.userId || this.ids
        getUser(row.userId).then(response => {
          this.form=response.data;
          this.form.uid=response.data.userId
          this.typeOpen = true;
          console.log(data.userId);
          console.log(this.form);

        });

      },
      // handleType(row) {
      //   //console.log(row)
      //   var abc =JSON.stringify(row);
      //   var d = JSON.parse(abc);
      //   this.raw2 = row;
      //   this.form1.uid = row.userId;
      //   this.form1.realName1 = d.realName;
      //   this.form1.wechat1 = d.wechat;
      //   console.log(row.userId);
      //   console.log(d.realName);
      //   console.log(d.wechat);
      //   this.typeOpen = true;
      // },
      cancel2() {
        this.typeOpen = false;
      },

      /** 查询用户列表 */
      getTypeList() {
        this.loading = true;
        this.queryParams.inviteFlag = 1;
        listUserType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
            this.userTypeList = response.rows;
            this.total = response.total;
            this.loading = false;
          }
        );
      },
      confirm2() {
        updateUser({
          userId: this.raw2.userId,
          peopleType: this.pType,
          //...this.form
        }).then(response => {
          //this.msgSuccess("设置成功");
          this.getList();
        });
        this.typeOpen = false;
      },


      /** 查询订单管理列表 */
      getOrderList() {
        this.queryParams.inviteFlag = 1;
        this.queryOrderParams.userId = this.form.userId;
        listUserOrder(this.queryOrderParams).then(response => {
          this.userOrderList = response.rows;
          this.userOrderTotal = response.total;
        });
      },
      /** 查询订单管理列表 */
      getReceiveList(id) {
        this.queryReceiveParams.receiveId = this.form.userId;
        listUserReceive(this.queryReceiveParams).then(response => {
          this.receiveList = response.rows;
          this.receiveTotal = response.total;
        });
      },

      /** 查询用户订单列表 */
      getUserOrderList() {
        this.loading = true;
        this.queryParams.inviteFlag = 1;
        listUserOrder(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
            // this.userList = response.rows;
            // this.total = response.total;
            this.loading = false;
          }
        );
      },
      /** 查询用户列表 */
      getList() {
        this.loading = true;
        this.queryParams.inviteFlag = 1;
        listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
            this.userList = response.rows;
            //console.log(this.userList)
            this.total = response.total;
            this.loading = false;
          }
        );
      },
      // 用户性别字典翻译
      sexFormat(row, column) {
        return this.selectDictLabel(this.sexOptions, row.sex);
      },

      // 用户状态修改
      handleStatusChange(row) {
        let text = row.status === "0" ? "启用" : "停用";
        this.$confirm('确认要"' + text + '""' + row.userName + '"用户吗?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function () {
          return changeUserStatus(row.userId, row.status);
        }).then(() => {
          this.msgSuccess(text + "成功");
        }).catch(function () {
          row.status = row.status === "0" ? "1" : "0";
        });
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.addressOpen = false;
        this.orderOpen = false;
        this.bankcardOpen = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.form = {
          userId: undefined,
          deptId: undefined,
          userName: undefined,
          nickName: undefined,
          password: undefined,
          phonenumber: undefined,
          peopleType: undefined,
          email: undefined,
          sex: undefined,
          status: "0",
          remark: undefined,
          postIds: [],
          roleIds: []
        };
        this.resetForm("form");
        this.disabled = false;
      },

      /** 重置按钮操作 */
      resetQuery() {
        this.dateRange = [];
        this.resetForm("queryForm");
        this.handleQuery();
      },

      /** 搜索按钮操作 */
      handleQuery() {
        console.log(this.queryParams)
        this.queryParams.page = 1;
        this.getList();
      },
      handleTabClick() {
        this.tabActiveName = "first"
      },
      /** 查看地址操作 */
      handleInviteList(row) {
        this.user = row;
        //console.log(row)
        const userId = row.userId || this.ids;
        this.orderOpen = true;
        this.$nextTick(()=>{
          getUser(userId).then(response => {
            this.form = response.data;
            // this.getOrderList();
            // this.getReceiveList();
            this.getInviteUserList(row);
          });
        });

      },
      getInviteUserList(row) {
          this.loading = true;
          this.queryInviteParams.inviteFlag = 1;
          this.queryInviteParams.inviteUserId=this.form.userId
        listInviteUser(this.addDateRange(this.queryInviteParams, this.dateRange)).then(response => {
          this.userList1 = response.rows;
          this.userTotal = response.total;
          this.loading = false;
        });
      }
    }
  };
</script>


